{extend name="public:_base" /}
{block name="js"}

{include file="public/_validform"}
{load href="__STATIC__/admin/hui/lib/My97DatePicker/4.8/WdatePicker.js" /}
{load href="__STATIC__/admin/js/common.js" /}
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>

<script type="text/javascript">
    var ue = UE.getEditor('editor',{toolbars: [
        ['fullscreen', 'source', 'undo', 'redo','selectall'],
        ['bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc']
    ]});
    $("[name='cid']").find("[value='{$data.cid ?? ''}']").attr("selected", true);

    // 遍历option的ID值 传值
    $('.select option').each(function(){
        var opID = $(this).attr('id');
        newopValue(opID);
    });

    // 获得option的ID值 来进行 option的value 来比较
    function newopValue(n){
        $('.select option').each(function(){
            var opValue = $(this).attr('value');
            if(opValue == n) {
                $(this).remove();
            }
        });
    }
</script>
{/block}

{block name="main"}

<div class="user_conver">

    {include file="public:_right"}

    <!-- 供应中心 -->
    <div class="user_item my_data">
        <!-- 标题 -->
        <div class="user_item_title">
            <i class="glyphicon glyphicon-cog"></i>
            发布/编辑 信息 <font>Publish/Edit INFORMATION</font>
        </div>
        <!-- #标题 -->

        <!-- 内容 -->
        <div class="user_item_cont user_info_cont">

            <form class="form form-horizontal" action="#" id="form" method="post">

                {include file="public:_navadd"}

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>{:lang('Supply title')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.title ?? ''}" placeholder="{:lang('title')}"  datatype="*" name="title">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>{:lang('Quick description')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <textarea name="miaoshu" cols="" rows="" class="textarea" placeholder="{:lang('Enter at least 10 characters')}" datatype="*10-100" dragonfly="true">{$data.miaoshu ?? ''}</textarea>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>{:lang('Quick description')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <select name="cid" class="select" style="padding: 4px 5px;">
                            {volist name="Supplynav" id="vo"}
                            <option id="{$vo.pid}" value="{$vo.id}">{$vo.id}{$vo.level}{$vo.html}{$vo.name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">{:lang('Contact')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.issue ?? ''}" placeholder="{:lang('Contact')}"  name="issue">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">{:lang('Price')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.price ?? ''}" placeholder="{:lang('Price')}"  name="price">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">{:lang('time')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.time|date="Y-m-d H:i:s",###}" placeholder="{:lang('time')}" onClick="selecttime(1)"   name="time">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>{:lang('content')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <script id="editor" type="text/plain" name="center" style="width:100%;height:400px;">{$data.center|default=''|html_entity_decode ?? ''}</script>
                    </div>
                </div>

                <div class="row cl" style="border-bottom: 0;">
                    {:token()}
                    <div class="col-xs-6 col-sm-6 col-xs-offset-4 col-sm-offset-2">
                        <input name="id" value="{$data.id ?? ''}"  type="hidden" />
                        <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;{:lang('save')}&nbsp;&nbsp;">
                        <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;{:lang('cancel')}&nbsp;&nbsp;">
                    </div>
                </div>
            </form>

        </div>
        <!-- #内容 -->
    </div>
    <!-- #供应中心 -->

</div>

{/block}
